<!DOCTYPE  html>
<html lang='en'>
	<head>
		<title>Comet php backend</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	</head>
	<body>
		<script type="text/javascript">
			// KHTML browser don't share javascripts between iframes
			var is_khtml = navigator.appName.match("Konqueror") || navigator.appVersion.match("KHTML");
			if (is_khtml) {
				var prototypejs = document.createElement('script');
				prototypejs.setAttribute('type', 'text/javascript');
				prototypejs.setAttribute('src', 'prototype.js');
				var head = document.getElementsByTagName('head');
				head[0].appendChild(prototypejs);
			}
			// load the comet object
			var comet = window.parent.comet;

		</script>
		<php>
			while(1) {
			echo '
			<script type="text/javascript">
				';
				echo 'comet.printServerTime('.time().');';
				echo '
			</script>';
			flush(); // used to send the echoed data to the client
			sleep(1); // a little break to unload the server CPU
			}
		</php>

	</body>
</html>